Skip to content

fix(server): normalize BatchSandbox create status#642

Merged
Pangjiping merged 1 commit intoalibaba:mainfrom
Gujiassh:fix/batchsandbox-running-state
Apr 7, 2026
Merged

fix(server): normalize BatchSandbox create status#642
Pangjiping merged 1 commit intoalibaba:mainfrom
Gujiassh:fix/batchsandbox-running-state

Conversation

@Gujiassh
Copy link
Copy Markdown
Contributor

@Gujiassh Gujiassh commented Apr 4, 2026

Summary

  • normalize create_sandbox responses to return Running once the create wait gate has already accepted a BatchSandbox workload as usable
  • keep the internal wait behavior unchanged while hiding the intermediate Allocated state from the public create response
  • add a focused regression test covering the Allocated to Running normalization path

Testing

  • cd server && uv run pytest tests/k8s/test_kubernetes_service.py -k \"create_sandbox_with_valid_request_succeeds or create_sandbox_normalizes_allocated_status_to_running or wait_for_allocated_pod_returns_immediately\"
  • cd server && uv run ruff check opensandbox_server/services/k8s/kubernetes_service.py tests/k8s/test_kubernetes_service.py

Stop leaking the internal Allocated state once create_sandbox has already passed its usability gate, and cover the create-path contract with a focused regression test.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Gujiassh
Copy link
Copy Markdown
Contributor Author

Gujiassh commented Apr 6, 2026

Quick validation from my side on the current branch tip:

  • cd server && uv sync --all-groups → synced cleanly
  • cd server && uv run ruff check opensandbox_server/services/k8s/kubernetes_service.py tests/k8s/test_kubernetes_service.py → passed
  • cd server && uv run pytest tests/k8s/test_kubernetes_service.py29 passed

So the BatchSandbox status-normalization behavior covered by this PR is locally green on the current head.

@Pangjiping
Copy link
Copy Markdown
Collaborator

closes #505

Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pangjiping Pangjiping merged commit 74117c2 into alibaba:main Apr 7, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants